<?php
    require '../feed/config/config.php';
	session_start();
	if(empty($_SESSION['member'])){
	    echo "<script>location='../index/index.php';</script>";
	}
	if(!empty($_SESSION['Master'])){
	    echo "<script>location='./index.php';</script>";
	}
    if($_POST){
        $UserSql="SELECT * FROM `member` WHERE user='".$_SESSION['member']."'";
		$UserInfo=mysqli_query($con,$UserSql);
		@$UserRs=mysqli_fetch_array($UserInfo);
		if($UserRs['type']=="1" || $UserRs['type']=="2"){
		    $_SESSION['Master']=$_SESSION['member'];
            echo "<script>alert('登录成功！');location='./index.php';</script>";
        }else{
            echo "<script>alert('此账号权限不足！');location='../index';</script>";
        }
    }
?>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台管理系统 - 登录</title>
    <link rel="stylesheet" type="text/css" href="css/login.css">
</head>
<body>
    <div id="wrapper" class="login-page">
        <div id="login_form" class="form">
            <form class="login-form" method="post">
                <h2>您还未登录后台管理系统，是否需要登录？</h2>
                <button type="submit" id="login" name="submit">登　录</button>
            </form>
            <br /><br />
            <a href="../index/index.php"><button id="login">返　回</button></a>
        </div>
    </div>
<script src="js/jquery.min.js"></script>
</body>
</html>